Q: In a leftist heap, all the operations should be performed on?
Solution: All the operations are performed on the right path because right paths are short. However, insertion and merges cannot be performed on the right path.
Q: What would be the result if the left subtree of the root has a null path length of 1 and the right subtree has a null path length of 2?
Solution: When two leftist heaps are merged, if the left subtree of the root has a null path length of 1 and the right subtree has a null path length of 2, leftist property is violated at the root.
Q: What happens if the null path length is not updated?
Solution: While performing insertion via merge operation in a leftist heap, if the null path length is not updated, all null path lengths will be 0.
Q: What is the time taken to delete a minimum element in a leftist heap?
Solution: The time taken to delete a minimum element in a leftist heap is mathematically found to be O(log N).
Q: In what time can a leftist heap be built?
Solution: The mathematical calculation yields a result that, a leftist heap can be built in O(N) time by building a binary heap.
Q: ___________ is a self-adjusting version of a leftist heap.
Solution: A skew heap is a self-adjusting version of a leftist heap and it is simpler to implement.
Q: The worst case running time of all operations in a skew heap is given as?
Solution: The worst case running time of all operations in a skew heap is mathematically found to be O(N).
Q: What is the amortized cost per operation of a skew heap?
Solution: The amortized cost per operation of a skew heap is O(log N) since the worst case analysis of skew heap is O(N) and splay tree is O(M log N).
You Have Score    | /8 |